import request from '@/utils/request'

const baseUrl = process.env.VUE_APP_local_API

export default {
  addUpdateItem(path, data) {
    return request({
      url: `${baseUrl}${path}/addUpdateItem`,
      method: 'post',
      data
    })
  },
  queryList(path, data) {
    return request({
      url: `${baseUrl}/${path}/queryList`,
      method: 'post',
      data
    })
  },
  queryListAll(path, data) {
    return request({
      url: `${baseUrl}/${path}/queryListAll`,
      method: 'post',
      data
    })
  },
  deleteById(path, id) {
    return request({
      url: `${baseUrl}/${path}/deleteById/${id}`,
      method: 'delete'
    })
  },
  getById(path, id) {
    return request({
      url: `${baseUrl}/${path}/getById/${id}`,
      method: 'get'
    })
  },
  queryListByIds(path, ids) {
    return request({
      url: `${baseUrl}/${path}/queryListByIds?ids=${ids}`,
      method: 'get'
    })
  }
}
